#include <iostream>
#include <queue>
#include <map>
#include <unordered_map>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <cstring>
#include <set>
#include <unordered_set>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
const int INF=0x3f3f3f3f;
int a[3010],b[3010];
int cul(int x,int y,int xx,int yy)
{
    return (x-xx)*(x-xx)+(y-yy)*(y-yy);
}
int vis[3010][3010];
int main()
{
	int n;
	cin>>n;
	for(int i=0;i<n;i++)
	{
		cin>>a[i]>>b[i];
        vis[a[i]+1500][b[i]+1500]++;
	}
	ll ans=0;
    ll sum=0;
	for(int i=0;i<n;i++)
	{
		unordered_map<int,int> cnt;
		for(int j=0;j<n;j++)
		{
            if(i==j) continue;
			int len=cul(a[i],b[i],a[j],b[j]);
			ans+=cnt[len];
            int x=a[i]-a[j]+a[i];
            int y=b[i]-b[j]+b[i];
            if(vis[x+1500][y+1500])
            {
                 sum++;
            }
			cnt[len]++;
		}
	}
	cout<<ans-sum/2;

	return 0;
}

